package com.joplus.housekeeper.bean;

import android.content.Context;
import android.text.SpannableStringBuilder;

import com.joplus.housekeeper.utils.StringUtils;

/**
 * Created by Administrator on 2016/11/21.
 */

public class OrderRelationListBean implements Comparable {


    /**
     * isShow : 1
     * orderId : order1479546781468ypaj
     * date : null
     * orderPathId : orderpaht1
     * status : 未支付
     * orderBy : 1
     */

    private String isShow;
    private String orderId;
    private String date;
    private String orderPathId;
    private String status;
    private Integer orderBy = 1;
    private String note;

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public String getIsShow() {
        return isShow;
    }

    public void setIsShow(String isShow) {
        this.isShow = isShow;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getOrderPathId() {
        return orderPathId;
    }

    public void setOrderPathId(String orderPathId) {
        this.orderPathId = orderPathId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getOrderBy() {
        if (orderBy == null) {
            return 1;
        }
        return orderBy;
    }

    public void setOrderBy(Integer orderBy) {

        this.orderBy = orderBy;
    }


    public OrderRelationListBean() {
    }


    @Override
    public String toString() {
        return super.toString();
    }

    public SpannableStringBuilder getOrderStatusDesc(Context context, Boolean isshowdate) {
        SpannableStringBuilder spBuilder = new SpannableStringBuilder();

        /*ForegroundColorSpan span = new ForegroundColorSpan(context.getResources().getColor(R.color.jo_text));
        AbsoluteSizeSpan aSpan = new AbsoluteSizeSpan(70);*/
        spBuilder.append(this.status + "");
     /*   spBuilder.setSpan(aSpan,0,spBuilder.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
        spBuilder.setSpan(span, 0, spBuilder.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);*/

        if (!StringUtils.isEmpty(date) && isshowdate) {
            spBuilder.append("   " + "\n\n" + this.date + "\n");

        }
        if (!StringUtils.isEmpty(note)) {
            spBuilder.append("\n" + note + "\n");
        }
        return spBuilder;

    }

    @Override
    public int compareTo(Object another) {
        OrderRelationListBean ob = (OrderRelationListBean) another;
        return getOrderBy().compareTo(ob.getOrderBy());
    }
}
